//
//  RDKVStorageFactoryMediator.h
//  RDelivery
//
//  Created by selmerzhang on 2021/8/10.
//  Copyright © 2021 Tencent. All rights reserved.
//

#ifndef RDKVStorageFactoryMediator_h
#define RDKVStorageFactoryMediator_h

#import <RaftInterface/RAFTKVStorageFactoryProtocol.h>

@class RDKVStorageMediator;

NS_ASSUME_NONNULL_BEGIN

@interface RDKVStorageFactoryMediator : NSObject <RAFTKVStorageFactoryProtocol>

/// 根据注入初始化中间层
/// @param factoryImpl 实现了RAFTKVStorageFactoryProtocol协议的实例
- (instancetype)initWithImpl:(id<RAFTKVStorageFactoryProtocol>)factoryImpl;

/// 初始化KV组件
/// @param rootDir 默认的存储根路径
- (void)initializeKVStorage:(nullable NSString *)rootDir;

/// 创建KV存储实例
/// @param name 存储的分组名，不同的分组隔离存储
- (RDKVStorageMediator *)createKVStorageWithName:(NSString *)name;

@end

NS_ASSUME_NONNULL_END

#endif /* RDKVStorageFactoryMediator_h */
